<?php
class Zendvn_View_Helper_CmsSort extends Zend_View_Helper_Abstract {
	
	//$this->formRadio($name,$value,$attribs,$options, $listep);
	/*$attribs = array(
					'icon'=>'icon-32-delete.png',
					'iconDir'=>'images/toolbar/',
				)*/
	//$options = array('type'=>'submit','name'=>'appForm');
	public function cmsSort($name, $arrFilter , $col, $sort = 'DESC') {
		
		$order = $sort;
		if ($arrFilter ['col'] == $col) {
			$order = ($arrFilter ['order'] == $sort) ? "ASC" : 'DESC';
			$sortIcon = ($arrFilter ['order'] == "DESC") ? "arrow_down.png" : 'arrow_up.png';
			$sortIcon = 'images/small-icons/' . $sortIcon;
			$sortIcon = ' <img src="' . $sortIcon . '" />';
		}
		
		$lnkID = $this->view->url ( array ('action' => 'filter', 'type' => 'sort', 'col' => $col, 'order' => $order ) );
		
		$xhtml = '<a href="' . $lnkID . '" style="color: #165582">' . $name . '</a>' . $sortIcon;
		
		return $xhtml;
	}
}